<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>反射</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="quickhashintstringhash.update.html">QuickHashIntStringHash::update</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="intro.reflection.html">简介</a></div>
 <div class="up"><a href="refs.basic.vartype.html">变量与类型相关扩展</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="book.reflection" class="book">
 
 <h1 class="title">反射</h1>
 

 

 









 









 









 









 








 








 








 








 








 








 








 








 








 








 








 









<ul class="chunklist chunklist_book"><li><a href="intro.reflection.html">简介</a></li><li><a href="reflection.setup.html">安装／配置</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="reflection.requirements.html">需求</a></li><li><a href="reflection.installation.html">安装</a></li><li><a href="reflection.configuration.html">运行时配置</a></li><li><a href="reflection.resources.html">资源类型</a></li></ul></li><li><a href="reflection.constants.html">预定义常量</a></li><li><a href="reflection.examples.html">范例</a></li><li><a href="reflection.extending.html">扩展</a></li><li><a href="class.reflection.html">Reflection</a> — Reflection 类<ul class="chunklist chunklist_book chunklist_children"><li><a href="reflection.export.html">Reflection::export</a> — Exports</li><li><a href="reflection.getmodifiernames.html">Reflection::getModifierNames</a> — 获取修饰符的名称</li></ul></li><li><a href="class.reflectionclass.html">ReflectionClass</a> — ReflectionClass 类<ul class="chunklist chunklist_book chunklist_children"><li><a href="reflectionclass.construct.html">ReflectionClass::__construct</a> — 构造一个 ReflectionClass 类</li><li><a href="reflectionclass.export.html">ReflectionClass::export</a> — 导出一个类</li><li><a href="reflectionclass.getconstant.html">ReflectionClass::getConstant</a> — 获取定义过的一个常量</li><li><a href="reflectionclass.getconstants.html">ReflectionClass::getConstants</a> — 获取一组常量</li><li><a href="reflectionclass.getconstructor.html">ReflectionClass::getConstructor</a> — 获取类的构造函数</li><li><a href="reflectionclass.getdefaultproperties.html">ReflectionClass::getDefaultProperties</a> — 获取默认属性</li><li><a href="reflectionclass.getdoccomment.html">ReflectionClass::getDocComment</a> — 获取文档注释</li><li><a href="reflectionclass.getendline.html">ReflectionClass::getEndLine</a> — 获取最后一行的行数</li><li><a href="reflectionclass.getextension.html">ReflectionClass::getExtension</a> — 根据已定义的类获取所在扩展的 ReflectionExtension 对象</li><li><a href="reflectionclass.getextensionname.html">ReflectionClass::getExtensionName</a> — 获取定义的类所在的扩展的名称</li><li><a href="reflectionclass.getfilename.html">ReflectionClass::getFileName</a> — 获取定义类的文件名</li><li><a href="reflectionclass.getinterfacenames.html">ReflectionClass::getInterfaceNames</a> — 获取接口（interface）名称</li><li><a href="reflectionclass.getinterfaces.html">ReflectionClass::getInterfaces</a> — 获取接口</li><li><a href="reflectionclass.getmethod.html">ReflectionClass::getMethod</a> — 获取一个类方法的 ReflectionMethod。</li><li><a href="reflectionclass.getmethods.html">ReflectionClass::getMethods</a> — 获取方法的数组</li><li><a href="reflectionclass.getmodifiers.html">ReflectionClass::getModifiers</a> — 获取修饰符</li><li><a href="reflectionclass.getname.html">ReflectionClass::getName</a> — 获取类名</li><li><a href="reflectionclass.getnamespacename.html">ReflectionClass::getNamespaceName</a> — 获取命名空间的名称</li><li><a href="reflectionclass.getparentclass.html">ReflectionClass::getParentClass</a> — 获取父类</li><li><a href="reflectionclass.getproperties.html">ReflectionClass::getProperties</a> — 获取一组属性</li><li><a href="reflectionclass.getproperty.html">ReflectionClass::getProperty</a> — 获取类的一个属性的 ReflectionProperty</li><li><a href="reflectionclass.getshortname.html">ReflectionClass::getShortName</a> — 获取短名</li><li><a href="reflectionclass.getstartline.html">ReflectionClass::getStartLine</a> — 获取起始行号</li><li><a href="reflectionclass.getstaticproperties.html">ReflectionClass::getStaticProperties</a> — 获取静态（static）属性</li><li><a href="reflectionclass.getstaticpropertyvalue.html">ReflectionClass::getStaticPropertyValue</a> — 获取静态（static）属性的值</li><li><a href="reflectionclass.gettraitaliases.html">ReflectionClass::getTraitAliases</a> — 返回 trait 别名的一个数组</li><li><a href="reflectionclass.gettraitnames.html">ReflectionClass::getTraitNames</a> — 返回这个类所使用 traits 的名称的数组</li><li><a href="reflectionclass.gettraits.html">ReflectionClass::getTraits</a> — 返回这个类所使用的 traits 数组</li><li><a href="reflectionclass.hasconstant.html">ReflectionClass::hasConstant</a> — 检查常量是否已经定义</li><li><a href="reflectionclass.hasmethod.html">ReflectionClass::hasMethod</a> — 检查方法是否已定义</li><li><a href="reflectionclass.hasproperty.html">ReflectionClass::hasProperty</a> — 检查属性是否已定义</li><li><a href="reflectionclass.implementsinterface.html">ReflectionClass::implementsInterface</a> — 接口的实现</li><li><a href="reflectionclass.innamespace.html">ReflectionClass::inNamespace</a> — 检查是否位于命名空间中</li><li><a href="reflectionclass.isabstract.html">ReflectionClass::isAbstract</a> — 检查类是否是抽象类（abstract）</li><li><a href="reflectionclass.iscloneable.html">ReflectionClass::isCloneable</a> — 返回了一个类是否可复制</li><li><a href="reflectionclass.isfinal.html">ReflectionClass::isFinal</a> — 检查类是否声明为 final</li><li><a href="reflectionclass.isinstance.html">ReflectionClass::isInstance</a> — 检查类的实例</li><li><a href="reflectionclass.isinstantiable.html">ReflectionClass::isInstantiable</a> — 检查类是否可实例化</li><li><a href="reflectionclass.isinterface.html">ReflectionClass::isInterface</a> — 检查类是否是一个接口（interface）</li><li><a href="reflectionclass.isinternal.html">ReflectionClass::isInternal</a> — 检查类是否由扩展或核心在内部定义</li><li><a href="reflectionclass.isiterateable.html">ReflectionClass::isIterateable</a> — 检查是否可迭代（iterateable）</li><li><a href="reflectionclass.issubclassof.html">ReflectionClass::isSubclassOf</a> — 检查是否为一个子类</li><li><a href="reflectionclass.istrait.html">ReflectionClass::isTrait</a> — 返回了是否为一个 trait</li><li><a href="reflectionclass.isuserdefined.html">ReflectionClass::isUserDefined</a> — 检查是否由用户定义的</li><li><a href="reflectionclass.newinstance.html">ReflectionClass::newInstance</a> — 从指定的参数创建一个新的类实例</li><li><a href="reflectionclass.newinstanceargs.html">ReflectionClass::newInstanceArgs</a> — 从给出的参数创建一个新的类实例。</li><li><a href="reflectionclass.newinstancewithoutconstructor.html">ReflectionClass::newInstanceWithoutConstructor</a> — 创建一个新的类实例而不调用它的构造函数</li><li><a href="reflectionclass.setstaticpropertyvalue.html">ReflectionClass::setStaticPropertyValue</a> — 设置静态属性的值</li><li><a href="reflectionclass.tostring.html">ReflectionClass::__toString</a> — 返回 ReflectionClass 对象字符串的表示形式。</li></ul></li><li><a href="class.reflectionzendextension.html">ReflectionZendExtension</a> — ReflectionZendExtension 类<ul class="chunklist chunklist_book chunklist_children"><li><a href="reflectionzendextension.clone.html">ReflectionZendExtension::__clone</a> — Clone handler</li><li><a href="reflectionzendextension.construct.html">ReflectionZendExtension::__construct</a> — Constructor</li><li><a href="reflectionzendextension.export.html">ReflectionZendExtension::export</a> — Export</li><li><a href="reflectionzendextension.getauthor.html">ReflectionZendExtension::getAuthor</a> — Gets author</li><li><a href="reflectionzendextension.getcopyright.html">ReflectionZendExtension::getCopyright</a> — Gets copyright</li><li><a href="reflectionzendextension.getname.html">ReflectionZendExtension::getName</a> — Gets name</li><li><a href="reflectionzendextension.geturl.html">ReflectionZendExtension::getURL</a> — Gets URL</li><li><a href="reflectionzendextension.getversion.html">ReflectionZendExtension::getVersion</a> — Gets version</li><li><a href="reflectionzendextension.tostring.html">ReflectionZendExtension::__toString</a> — To string handler</li></ul></li><li><a href="class.reflectionextension.html">ReflectionExtension</a> — ReflectionExtension 类<ul class="chunklist chunklist_book chunklist_children"><li><a href="reflectionextension.clone.html">ReflectionExtension::__clone</a> — Clones</li><li><a href="reflectionextension.construct.html">ReflectionExtension::__construct</a> — Constructs a ReflectionExtension</li><li><a href="reflectionextension.export.html">ReflectionExtension::export</a> — Export</li><li><a href="reflectionextension.getclasses.html">ReflectionExtension::getClasses</a> — Gets classes</li><li><a href="reflectionextension.getclassnames.html">ReflectionExtension::getClassNames</a> — Gets class names</li><li><a href="reflectionextension.getconstants.html">ReflectionExtension::getConstants</a> — Gets constants</li><li><a href="reflectionextension.getdependencies.html">ReflectionExtension::getDependencies</a> — Gets dependencies</li><li><a href="reflectionextension.getfunctions.html">ReflectionExtension::getFunctions</a> — Gets extension functions</li><li><a href="reflectionextension.getinientries.html">ReflectionExtension::getINIEntries</a> — Gets extension ini entries</li><li><a href="reflectionextension.getname.html">ReflectionExtension::getName</a> — Gets extension name</li><li><a href="reflectionextension.getversion.html">ReflectionExtension::getVersion</a> — Gets extension version</li><li><a href="reflectionextension.info.html">ReflectionExtension::info</a> — Print extension info</li><li><a href="reflectionextension.ispersistent.html">ReflectionExtension::isPersistent</a> — Returns whether this extension is persistent</li><li><a href="reflectionextension.istemporary.html">ReflectionExtension::isTemporary</a> — Returns whether this extension is temporary</li><li><a href="reflectionextension.tostring.html">ReflectionExtension::__toString</a> — To string</li></ul></li><li><a href="class.reflectionfunction.html">ReflectionFunction</a> — ReflectionFunction 类<ul class="chunklist chunklist_book chunklist_children"><li><a href="reflectionfunction.construct.html">ReflectionFunction::__construct</a> — Constructs a ReflectionFunction object</li><li><a href="reflectionfunction.export.html">ReflectionFunction::export</a> — Exports function</li><li><a href="reflectionfunction.getclosure.html">ReflectionFunction::getClosure</a> — Returns a dynamically created closure for the function</li><li><a href="reflectionfunction.invoke.html">ReflectionFunction::invoke</a> — Invokes function</li><li><a href="reflectionfunction.invokeargs.html">ReflectionFunction::invokeArgs</a> — Invokes function args</li><li><a href="reflectionfunction.isdisabled.html">ReflectionFunction::isDisabled</a> — Checks if function is disabled</li><li><a href="reflectionfunction.tostring.html">ReflectionFunction::__toString</a> — To string</li></ul></li><li><a href="class.reflectionfunctionabstract.html">ReflectionFunctionAbstract</a> — ReflectionFunctionAbstract 类<ul class="chunklist chunklist_book chunklist_children"><li><a href="reflectionfunctionabstract.clone.html">ReflectionFunctionAbstract::__clone</a> — Clones function</li><li><a href="reflectionfunctionabstract.getclosurescopeclass.html">ReflectionFunctionAbstract::getClosureScopeClass</a> — Returns the scope associated to the closure</li><li><a href="reflectionfunctionabstract.getclosurethis.html">ReflectionFunctionAbstract::getClosureThis</a> — Returns this pointer bound to closure</li><li><a href="reflectionfunctionabstract.getdoccomment.html">ReflectionFunctionAbstract::getDocComment</a> — Gets doc comment</li><li><a href="reflectionfunctionabstract.getendline.html">ReflectionFunctionAbstract::getEndLine</a> — Gets end line number</li><li><a href="reflectionfunctionabstract.getextension.html">ReflectionFunctionAbstract::getExtension</a> — Gets extension info</li><li><a href="reflectionfunctionabstract.getextensionname.html">ReflectionFunctionAbstract::getExtensionName</a> — Gets extension name</li><li><a href="reflectionfunctionabstract.getfilename.html">ReflectionFunctionAbstract::getFileName</a> — Gets file name</li><li><a href="reflectionfunctionabstract.getname.html">ReflectionFunctionAbstract::getName</a> — Gets function name</li><li><a href="reflectionfunctionabstract.getnamespacename.html">ReflectionFunctionAbstract::getNamespaceName</a> — Gets namespace name</li><li><a href="reflectionfunctionabstract.getnumberofparameters.html">ReflectionFunctionAbstract::getNumberOfParameters</a> — Gets number of parameters</li><li><a href="reflectionfunctionabstract.getnumberofrequiredparameters.html">ReflectionFunctionAbstract::getNumberOfRequiredParameters</a> — Gets number of required parameters</li><li><a href="reflectionfunctionabstract.getparameters.html">ReflectionFunctionAbstract::getParameters</a> — Gets parameters</li><li><a href="reflectionfunctionabstract.getshortname.html">ReflectionFunctionAbstract::getShortName</a> — Gets function short name</li><li><a href="reflectionfunctionabstract.getstartline.html">ReflectionFunctionAbstract::getStartLine</a> — Gets starting line number</li><li><a href="reflectionfunctionabstract.getstaticvariables.html">ReflectionFunctionAbstract::getStaticVariables</a> — Gets static variables</li><li><a href="reflectionfunctionabstract.innamespace.html">ReflectionFunctionAbstract::inNamespace</a> — Checks if function in namespace</li><li><a href="reflectionfunctionabstract.isclosure.html">ReflectionFunctionAbstract::isClosure</a> — Checks if closure</li><li><a href="reflectionfunctionabstract.isdeprecated.html">ReflectionFunctionAbstract::isDeprecated</a> — Checks if deprecated</li><li><a href="reflectionfunctionabstract.isgenerator.html">ReflectionFunctionAbstract::isGenerator</a> — Returns whether this function is a generator</li><li><a href="reflectionfunctionabstract.isinternal.html">ReflectionFunctionAbstract::isInternal</a> — Checks if is internal</li><li><a href="reflectionfunctionabstract.isuserdefined.html">ReflectionFunctionAbstract::isUserDefined</a> — Checks if user defined</li><li><a href="reflectionfunctionabstract.returnsreference.html">ReflectionFunctionAbstract::returnsReference</a> — Checks if returns reference</li><li><a href="reflectionfunctionabstract.tostring.html">ReflectionFunctionAbstract::__toString</a> — To string</li></ul></li><li><a href="class.reflectionmethod.html">ReflectionMethod</a> — ReflectionMethod 类<ul class="chunklist chunklist_book chunklist_children"><li><a href="reflectionmethod.construct.html">ReflectionMethod::__construct</a> — Constructs a ReflectionMethod</li><li><a href="reflectionmethod.export.html">ReflectionMethod::export</a> — Export a reflection method.</li><li><a href="reflectionmethod.getclosure.html">ReflectionMethod::getClosure</a> — Returns a dynamically created closure for the method</li><li><a href="reflectionmethod.getdeclaringclass.html">ReflectionMethod::getDeclaringClass</a> — Gets declaring class for the reflected method.</li><li><a href="reflectionmethod.getmodifiers.html">ReflectionMethod::getModifiers</a> — Gets the method modifiers</li><li><a href="reflectionmethod.getprototype.html">ReflectionMethod::getPrototype</a> — Gets the method prototype (if there is one).</li><li><a href="reflectionmethod.invoke.html">ReflectionMethod::invoke</a> — Invoke</li><li><a href="reflectionmethod.invokeargs.html">ReflectionMethod::invokeArgs</a> — Invoke args</li><li><a href="reflectionmethod.isabstract.html">ReflectionMethod::isAbstract</a> — Checks if method is abstract</li><li><a href="reflectionmethod.isconstructor.html">ReflectionMethod::isConstructor</a> — Checks if method is a constructor</li><li><a href="reflectionmethod.isdestructor.html">ReflectionMethod::isDestructor</a> — Checks if method is a destructor</li><li><a href="reflectionmethod.isfinal.html">ReflectionMethod::isFinal</a> — Checks if method is final</li><li><a href="reflectionmethod.isprivate.html">ReflectionMethod::isPrivate</a> — Checks if method is private</li><li><a href="reflectionmethod.isprotected.html">ReflectionMethod::isProtected</a> — Checks if method is protected</li><li><a href="reflectionmethod.ispublic.html">ReflectionMethod::isPublic</a> — Checks if method is public</li><li><a href="reflectionmethod.isstatic.html">ReflectionMethod::isStatic</a> — Checks if method is static</li><li><a href="reflectionmethod.setaccessible.html">ReflectionMethod::setAccessible</a> — Set method accessibility</li><li><a href="reflectionmethod.tostring.html">ReflectionMethod::__toString</a> — Returns the string representation of the Reflection method object.</li></ul></li><li><a href="class.reflectionobject.html">ReflectionObject</a> — ReflectionObject 类<ul class="chunklist chunklist_book chunklist_children"><li><a href="reflectionobject.construct.html">ReflectionObject::__construct</a> — Constructs a ReflectionObject</li><li><a href="reflectionobject.export.html">ReflectionObject::export</a> — Export</li></ul></li><li><a href="class.reflectionparameter.html">ReflectionParameter</a> — ReflectionParameter 类<ul class="chunklist chunklist_book chunklist_children"><li><a href="reflectionparameter.allowsnull.html">ReflectionParameter::allowsNull</a> — Checks if null is allowed</li><li><a href="reflectionparameter.canbepassedbyvalue.html">ReflectionParameter::canBePassedByValue</a> — Returns whether this parameter can be passed by value</li><li><a href="reflectionparameter.clone.html">ReflectionParameter::__clone</a> — Clone</li><li><a href="reflectionparameter.construct.html">ReflectionParameter::__construct</a> — Construct</li><li><a href="reflectionparameter.export.html">ReflectionParameter::export</a> — Exports</li><li><a href="reflectionparameter.getclass.html">ReflectionParameter::getClass</a> — Get the type hinted class</li><li><a href="reflectionparameter.getdeclaringclass.html">ReflectionParameter::getDeclaringClass</a> — Gets declaring class</li><li><a href="reflectionparameter.getdeclaringfunction.html">ReflectionParameter::getDeclaringFunction</a> — Gets declaring function</li><li><a href="reflectionparameter.getdefaultvalue.html">ReflectionParameter::getDefaultValue</a> — Gets default parameter value</li><li><a href="reflectionparameter.getdefaultvalueconstantname.html">ReflectionParameter::getDefaultValueConstantName</a> — Returns the default value's constant name if default value is constant or null</li><li><a href="reflectionparameter.getname.html">ReflectionParameter::getName</a> — Gets parameter name</li><li><a href="reflectionparameter.getposition.html">ReflectionParameter::getPosition</a> — Gets parameter position</li><li><a href="reflectionparameter.isarray.html">ReflectionParameter::isArray</a> — Checks if parameter expects an array</li><li><a href="reflectionparameter.iscallable.html">ReflectionParameter::isCallable</a> — Returns whether parameter MUST be callable</li><li><a href="reflectionparameter.isdefaultvalueavailable.html">ReflectionParameter::isDefaultValueAvailable</a> — Checks if a default value is available</li><li><a href="reflectionparameter.isdefaultvalueconstant.html">ReflectionParameter::isDefaultValueConstant</a> — Returns whether the default value of this parameter is constant</li><li><a href="reflectionparameter.isoptional.html">ReflectionParameter::isOptional</a> — Checks if optional</li><li><a href="reflectionparameter.ispassedbyreference.html">ReflectionParameter::isPassedByReference</a> — Checks if passed by reference</li><li><a href="reflectionparameter.tostring.html">ReflectionParameter::__toString</a> — To string</li></ul></li><li><a href="class.reflectionproperty.html">ReflectionProperty</a> — ReflectionProperty 类<ul class="chunklist chunklist_book chunklist_children"><li><a href="reflectionproperty.clone.html">ReflectionProperty::__clone</a> — Clone</li><li><a href="reflectionproperty.construct.html">ReflectionProperty::__construct</a> — Construct a ReflectionProperty object</li><li><a href="reflectionproperty.export.html">ReflectionProperty::export</a> — Export</li><li><a href="reflectionproperty.getdeclaringclass.html">ReflectionProperty::getDeclaringClass</a> — Gets declaring class</li><li><a href="reflectionproperty.getdoccomment.html">ReflectionProperty::getDocComment</a> — Gets doc comment</li><li><a href="reflectionproperty.getmodifiers.html">ReflectionProperty::getModifiers</a> — Gets modifiers</li><li><a href="reflectionproperty.getname.html">ReflectionProperty::getName</a> — Gets property name</li><li><a href="reflectionproperty.getvalue.html">ReflectionProperty::getValue</a> — Gets value</li><li><a href="reflectionproperty.isdefault.html">ReflectionProperty::isDefault</a> — Checks if default value</li><li><a href="reflectionproperty.isprivate.html">ReflectionProperty::isPrivate</a> — Checks if property is private</li><li><a href="reflectionproperty.isprotected.html">ReflectionProperty::isProtected</a> — Checks if property is protected</li><li><a href="reflectionproperty.ispublic.html">ReflectionProperty::isPublic</a> — Checks if property is public</li><li><a href="reflectionproperty.isstatic.html">ReflectionProperty::isStatic</a> — Checks if property is static</li><li><a href="reflectionproperty.setaccessible.html">ReflectionProperty::setAccessible</a> — Set property accessibility</li><li><a href="reflectionproperty.setvalue.html">ReflectionProperty::setValue</a> — Set property value</li><li><a href="reflectionproperty.tostring.html">ReflectionProperty::__toString</a> — To string</li></ul></li><li><a href="class.reflector.html">Reflector</a> — Reflector 接口<ul class="chunklist chunklist_book chunklist_children"><li><a href="reflector.export.html">Reflector::export</a> — Exports</li><li><a href="reflector.tostring.html">Reflector::__toString</a> — 转化成字符串</li></ul></li><li><a href="class.reflectionexception.html">ReflectionException</a> — ReflectionException 类</li></ul></div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="quickhashintstringhash.update.html">QuickHashIntStringHash::update</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="intro.reflection.html">简介</a></div>
 <div class="up"><a href="refs.basic.vartype.html">变量与类型相关扩展</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
